package com.lucenly.spell.activity

import android.graphics.Color
import android.view.View
import com.lucenly.spell.base.BaseActivity
import com.lucenly.spell.databinding.ActivityLoginBinding
import com.lucenly.spell.utils.DisplayUtil
import com.lucenly.spell.utils.ShadowDrawable
import com.moregold.mvvmlib.ext.ext_doubleClick
import com.moregold.mvvmlib.ext.startActivity


class LoginActivity : BaseActivity<ActivityLoginBinding>() {
    override fun getViewBinding(): ActivityLoginBinding {
        return ActivityLoginBinding.inflate(layoutInflater,baseBinding.contentMain,true)
    }

    override fun setTitle(): String {
        return "登录"
    }

    override fun initData() {
        ShadowDrawable.setShadowDrawable(
            binding.llEditBg,
                Color.parseColor("#ffffff"), DisplayUtil.dip2px(this, 15f),
            Color.parseColor("#f5f5f5"), 15, 0, DisplayUtil.dip2px(this, 5f)
        )
    }

    override fun initEvent() {
        binding.tvCodeLogin.ext_doubleClick {
            binding.llCode.visibility = View.VISIBLE
            binding.llMobile.visibility = View.GONE

        }
        binding.tvOther.ext_doubleClick {
            binding.llCode.visibility = View.VISIBLE
            binding.llMobile.visibility = View.GONE

        }
        binding.tvMobileLogin.ext_doubleClick {
            binding.llMobile.visibility = View.VISIBLE
            binding.llCode.visibility = View.GONE

        }
        binding.tvLogin.ext_doubleClick {
            startActivity<MainActivity>()
        }
    }

    override fun startObserve() {
    }

    override fun getStatusType(): Int {
        return 0
    }
}